var borderColorNormal="#e4e2dc";var borderColorOver="#4B4B6F";var borderColorSet="#4B4B6F";var borderColorSetOver="#4B4B6F";var bgroundColorOver="#FFC678";var bgroundColorSet="#FFC678";var bgroundColorSetOver="#FFA658";function BXButton(){this._prevDisabledState=false}BXButton.prototype={_Create:function(){if(this.OnCreate&&this.OnCreate()==false)return false;var t=this;if(this.id&&this.iconkit){this.pWnd=this.CreateElement("IMG",{src:one_gif_src,alt:this.title?this.title:this.name,title:this.title?this.title:this.name,width:"20",height:"20",id:"bx_btn_"+t.id});this.pWnd.className="bxedtbutton";this.pWnd.style.backgroundImage="url("+image_path+"/"+this.iconkit+")"}else{this.pWnd=this.CreateElement("IMG",{src:this.src,alt:this.title?this.title:this.name,title:this.title?this.title:this.name,width:"20",height:"20"});this.pWnd.className="bxedtbutton"}if(this.show_name){var e=this.pWnd;this.pWnd=BX.create("TABLE",{props:{className:"bxedtbuttonex",title:this.title?this.title:this.name,id:"bx_btnex_"+t.id}});this.pWnd.checked=false;this.pWnd.disabled=false;var i=this.pWnd.insertRow(-1);i.insertCell(-1).appendChild(e);BX.adjust(i.insertCell(-1),{props:{className:"tdbutex_txt"},html:"<div>"+this.name+"</div>"})}else{this.pWnd.style.borderColor=borderColorNormal;this.pWnd.style.borderWidth="1px";this.pWnd.style.borderStyle="solid"}if(!this.no_actions||this.no_actions!=true){this.pWnd.onmouseover=function(t){if(!this.disabled){if(this.nodeName.toLowerCase()=="table"){BX.addClass(this,"bxedtbuttonex-over");if(BX.browser.IsOpera())this.border="1px solid #4B4B6F"}else{this.style.borderColor=borderColorOver;this.style.border="#4B4B6F 1px solid";this.style.backgroundColor=this.checked?bgroundColorSetOver:bgroundColorOver}}};this.pWnd.onmouseout=function(t){if(!this.disabled){if(this.nodeName.toLowerCase()=="table"){BX.removeClass(this,"bxedtbuttonex-over");if(BX.browser.IsOpera())this.border="1px solid #E4E2DC"}else{this.style.borderColor=this.checked?borderColorSet:borderColorNormal;this.style.backgroundColor=this.checked?bgroundColorSet:"transparent"}}};if(this.defaultState)this.Check(true);addCustomElementEvent(this.pWnd,"click",this.OnClick,this);this.pMainObj.AddEventHandler("OnSelectionChange",this._OnSelectionChange,this);this.pMainObj.AddEventHandler("OnChangeView",this.OnChangeView,this)}},_OnChangeView:function(t,e){t=t=="split"?e:t;if(t=="code"&&!this.codeEditorMode||t=="html"&&this.hideInHtmlEditorMode){this._prevDisabledState=this.pWnd.disabled;this.Disable(true)}else if(t=="code"&&this.codeEditorMode||this.hideInHtmlEditorMode&&t!="html")this.Disable(false);else if(!this.codeEditorMode)this.Disable(this._prevDisabledState)},OnChangeView:function(t,e){this._OnChangeView(t,e)},Disable:function(t){if(t==this.pWnd.disabled)return false;this.pWnd.disabled=t;if(t){BX.addClass(this.pWnd,"bxedtbutton-disabled");if(this.id&&this.iconkit){}else{}}else{BX.removeClass(this.pWnd,"bxedtbutton-disabled");if(this.pWnd.checked){this.pWnd.style.borderColor=borderColorSet;this.pWnd.style.backgroundColor=bgroundColorSet}else{this.pWnd.style.backgroundColor="";this.pWnd.style.borderColor=borderColorNormal}}},Check:function(t){if(t==this.pWnd.checked)return false;this.pWnd.checked=t;if(!this.pWnd.disabled){if(this.pWnd.checked){this.pWnd.style.borderColor=borderColorSet;this.pWnd.style.backgroundColor=bgroundColorSet}else{this.pWnd.style.backgroundColor="";this.pWnd.style.borderColor=borderColorNormal}}},OnMouseOver:function(t){if(!this.disabled){this.style.borderColor=borderColorOver;this.style.border="#4B4B6F 1px solid";if(this.checked)this.style.backgroundColor=bgroundColorSetOver;else this.style.backgroundColor=bgroundColorOver}},OnMouseOut:function(t){if(!this.disabled){if(this.checked){this.style.borderColor=borderColorSet;this.style.backgroundColor=bgroundColorSet}else{this.style.backgroundColor="";this.style.borderColor=borderColorNormal}}},OnClick:function(t){if(this.pWnd.disabled)return false;this.pMainObj.SetFocus();var e=false;if(this.handler)if(this.handler(this.pMainObj)!==false)e=true;if(!e)e=this.pMainObj.executeCommand(this.cmd);if(!this.bNotFocus)this.pMainObj.SetFocus();return e},_OnSelectionChange:function(){if(this.OnSelectionChange)this.OnSelectionChange();else if(this.cmd){var t;if(this.cmd=="Unlink"&&!BXFindParentByTagName(this.pMainObj.GetSelectionObject(),"A"))t="DISABLED";else t=this.pMainObj.queryCommandState(this.cmd);if(t=="DISABLED")this.Disable(true);else if(t=="CHECKED"){this.Disable(false);this.Check(true)}else{this.Disable(false);this.Check(false)}}}};function BXButtonSeparator(){}BXButtonSeparator.prototype._Create=function(){this.pWnd=this.CreateElement("DIV",{className:"bxseparator"});this.OnToolbarChangeDirection=function(t){if(t)BX.addClass(this.pWnd,"bxseparator-ver");else BX.removeClass(this.pWnd,"bxseparator-ver")}};function BXEdList(){this.iSelectedIndex=-1;this.disabled=false;this.bCreated=false;this.bOpened=false;this.zIndex=2090;this.CSS="div.bx-list-cont {background-color: #fff; display: none; overflow: auto; overflow-x: hidden; overflow-y: auto; text-overflow: ellipsis;}"+"div.bx-list-cont-vis-ef{overflow: hidden!important;}"+"div.bx-list-cont table.bx-list-popup-tbl{width: 100%!important; border-collapse: collapse !important;}"+"div.bx-list-cont table.bx-list-popup-tbl td{padding: 0!important;}"+"div.bx-list-cont .bx-list-item{background: #fff; padding: 0px !important; border: 1px solid #fff; padding: 3px 4px !important; margin: 1px 0!important; cursor: default!important; font-family: Verdana,Tahoma,Courier New !important;}"+"div.bx-list-cont .bx-list-item-over{border: 1px solid #4B4B6F; background-color: #FFC678 !important;}"+"div.bx-list-cont .bx-list-item *{padding: 0!important; margin: 0!important; font-family: Verdana,Tahoma,Courier New !important;}"+"div.bx-list-cont table.bx-list-item{border-collapse: collapse!important; width:100%!important; padding: 0!important;}"+"div.bx-list-cont table.bx-list-item td{padding: 3px 4px !important;}"+"div.bx-list-cont a.bx-list-conf-link{display: block!important; font-size: 11px!important; margin: 5px!important; color: #000!important; cursor: pointer!important;}"+"div.bx-list-cont  td.bx-list-conf-cell{background: #FFF!important; border-top: 2px solid #808080!important;}"+"div.bx-list-cont  td.bx-list-conf-cell a{color: #000!important; font-weight: normal!important; text-decoration: underline!important; font-size: 14px!important; cursor: pointer!important; display: block!important; margin: 5px 10px;}"}BXEdList.prototype={_Create:function(){if(this.OnCreate&&this.OnCreate()==false)return false;if(this.maxHeight)this.maxHeight=parseInt(this.maxHeight);this.width=parseInt(this.width)||160;this.height=parseInt(this.height)||250;this.field_size=parseInt(this.field_size)||75;if(this.OnSelectionChange)this.pMainObj.AddEventHandler("OnSelectionChange",this.OnSelectionChange,this);if(this.disableOnCodeView)this.pMainObj.AddEventHandler("OnChangeView",this.OnChangeView,this);this.pWnd=BX.create("DIV",{props:{className:"bx-list"}});if(BX.browser.IsIE()&&!BX.browser.IsDoctype())this.pWnd.style.height="20px";this.pWnd.appendChild(BX.create("IMG",{props:{src:one_gif_src,className:"bx-list-over"}}));var t=this.pWnd.appendChild(BX.create("TABLE")),e=t.insertRow(-1);if(this.field_size)this.pWnd.style.width=t.style.width=this.field_size+"px";this.pTitleCell=e.insertCell(-1);this.pTitle=this.pTitleCell.appendChild(BX.create("DIV",{props:{className:"bx-listtitle",unselectable:"on"},text:this.title||"",style:{width:this.field_size-24+"px"}}));BX.adjust(e.insertCell(-1),{props:{className:"bx-listbutton",unselectable:"on"},html:"&nbsp;"});this.pWnd.onmouseover=BX.proxy(this.OnMouseOver,this);this.pWnd.onmouseout=BX.proxy(this.OnMouseOut,this);this.pWnd.onclick=BX.proxy(this.OnClick,this);this.Create();if(this.values)this.SetValues(this.values);if(this._OnInit&&typeof this._OnInit=="function")this._OnInit();if(this.OnInit&&this.OnInit()==false)return false;return true},Create:function(){if(!BXPopupWindow.bCreated)BXPopupWindow.Create();this.pPopupNode=BXPopupWindow.pDocument.body.appendChild(BX.create("DIV",{props:{className:"bx-list-cont"},style:{zIndex:this.zIndex}},BXPopupWindow.pDocument));this.bCreated=true;this.pPopupNode.style.width=this.width+"px";this.pPopupNode.style.height=this.height+"px";this.pDropDownList=this.pPopupNode.appendChild(BX.create("TABLE",{props:{className:"bx-list-popup-tbl",unselectable:"on"}},BXPopupWindow.pDocument))},OnClick:function(t){if(this.disabled)return false;if(this.bOpened)return this.Close();this.Open();this.ShowPopup(true)},ShowPopup:function(t){var e=BXPopupWindow.pFrame;if(t){e.height="1px";e.width=this.field_size+"px"}var i=this,s=t?1:parseInt(e.height),o=t?this.field_size:parseInt(e.width),n=0,a=BX.browser.IsIE()?1:8,l=0,r=this.width,h=20,d=BX.browser.IsIE()?20:10;if(this.Interval)clearInterval(this.Interval);BX.addClass(i.pPopupNode,"bx-list-cont-vis-ef");this.Interval=setInterval(function(){if(t){if(l==0){l=parseInt(i.pDropDownList.offsetHeight);if(i.maxHeight&&l>=i.maxHeight)l=i.maxHeight}s+=Math.round(d*n);o+=Math.round(h*n);if(o>r)o=r;if(s>l){BX.removeClass(i.pPopupNode,"bx-list-cont-vis-ef");clearInterval(i.Interval);if(BX.browser.IsIE())i.pDropDownList.style.width=parseInt(i.pDropDownList.offsetWidth)-2+"px";s=parseInt(i.pDropDownList.offsetHeight);if(i.maxHeight&&s>=i.maxHeight)s=i.maxHeight}}else{s-=Math.round(d*n);o-=Math.round(h*n);if(o<i.field_size)o=i.field_size;if(s<0){BX.removeClass(i.pPopupNode,"bx-list-cont-vis-ef");i._Close();s=0;clearInterval(i.Interval)}}e.width=i.pPopupNode.style.width=o+"px";e.height=i.pPopupNode.style.height=s+"px";n++},a)},Open:function(){var t=BX.pos(this.pWnd),e=this;BX.bind(document,"keyup",BX.proxy(this.OnKey,this));BX.bind(this.pMainObj.pEditorDocument,"keyup",BX.proxy(this.OnKey,this));oPrevRange=BXGetSelectionRange(this.pMainObj.pEditorDocument,this.pMainObj.pEditorWindow);if(this.bSetGlobalStyles)BXPopupWindow.SetStyles(this.CSS);else BXPopupWindow.SetStyles(this.CSS+"\n\n"+this.pMainObj.oStyles.sStyles,false);BXPopupWindow.Show({top:t.top+(BX.browser.IsIE()&&!BX.browser.IsDoctype()?17:19),left:t.left+(BX.browser.IsIE()&&!BX.browser.IsDoctype()?-2:0),node:this.pPopupNode,width:this.width,height:this.height});var i=BXPopupWindow.pFrame.style.zIndex-1;var s=this.pMainObj.oTransOverlay.Show({zIndex:i});s.onclick=function(){e.Close()};this.bOpened=true},Close:function(){this.ShowPopup(false)},_Close:function(){BXPopupWindow.Hide();this.pPopupNode.style.display="none";this.pMainObj.oTransOverlay.Hide();BX.unbind(document,"keyup",BX.proxy(this.OnKey,this));BX.unbind(this.pMainObj.pEditorDocument,"keyup",BX.proxy(this.OnKey,this));this.bOpened=false},OnKey:function(t){if(!t)t=window.event;if(t.keyCode==27&&this.bOpened)this.Close()},SetValues:function(t){if(typeof t=="object")this.values=t;BX.cleanNode(this.pDropDownList);var e,i,s=this,o,n=this.values.length;for(o=0;o<n;o++){this.values[o].index=o;e=this.pDropDownList.insertRow(-1).insertCell(-1);i=e.appendChild(BX.create("DIV",{props:{className:"bx-list-item",title:this.values[o].name}},BXPopupWindow.pDocument));i.innerHTML=this.OnDrawItem?this.OnDrawItem(this.values[o]):this.values[o].name;i.value=this.values[o];if(this.bSetFontSize)i.style.fontSize="12px";i.onmouseover=function(t){BX.addClass(this,"bx-list-item-over")};i.onmouseout=function(t){BX.removeClass(this,"bx-list-item-over")};i.onclick=function(){if(oPrevRange)BXSelectRange(oPrevRange,s.pMainObj.pEditorDocument,s.pMainObj.pEditorWindow);s.Close();s._OnChange(this.value);s.FireChangeEvent()}}if(this.bAdminConfigure&&false){e=this.pDropDownList.insertRow(-1).insertCell(-1);e.className="bx-list-conf-cell";var a=e.appendChild(BX.create("A",{props:{className:"bx-list-conf-link",title:BX_MESS.ListConfigTitle,href:"javascript:void(0);"},text:BX_MESS.ListConfig},BXPopupWindow.pDocument));a.onclick=function(){s.Close()}}},_OnChangeView:function(t,e){t=t=="split"?e:t;this.Disable(t=="code")},OnChangeView:function(t,e){this._OnChangeView(t,e)},Disable:function(t){if(this.disabled==t)return false;this.disabled=t;if(t)BX.addClass(this.pWnd,"bx-list-disabled");else BX.removeClass(this.pWnd,"bx-list-disabled")},FireChangeEvent:function(){if(this.OnChange)this.OnChange(this.arSelected)},_OnChange:function(t){this.Select(t["index"])},SetValue:function(t){if(!this.pTitle)return;this.pTitle.innerHTML=t||this.title||""},OnMouseOver:function(t){if(!this.disabled)BX.addClass(this.pWnd,"bx-list-over")},OnMouseOut:function(t){if(!this.disabled)BX.removeClass(this.pWnd,"bx-list-over")},Select:function(t){if(this.iSelectedIndex==t||t>=this.values.length)return;var e=this.values[t];this.iSelectedIndex=t;this.arSelected=e;this.SetValue(e["name"])},SelectByVal:function(t,e){if(t){var i,s=this.values.length;for(i=0;i<s;i++){if(this.values[i].value==t)return this.Select(i)}if(e){var o=this.values.length;this.values.push({name:t,value:t});this.SetValues(this.values);if(this.CreateListRow)this.additionalClass=t;return this.Select(o)}}else{this.SetValue(this.title||"");this.iSelectedIndex=-1}},OnToolbarChangeDirection:function(t){if(t){this.pWnd.style.width="18px";this.pTitleCell.style.visibility="hidden"}else{this.pWnd.style.width=this.field_size;this.pTitleCell.style.visibility="inherit"}}};function BXStyleList(){}BXStyleList.prototype=new BXEdList;BXStyleList.prototype._OnInit=function(){this.pMainObj.AddEventHandler("OnTemplateChanged",this.FillList,this);this.FillList()};BXStyleList.prototype.FillList=function(){var t,e,i,s;BX.cleanNode(this.pDropDownList);if(!this.filter)this._SetFilter();this.values=[];if(!this.tag_name)this.tag_name="";this.CreateListRow("",BX_MESS.DeleteStyleOpt,{value:"",name:BX_MESS.DeleteStyleOptTitle});var o,n=0,a=this.pMainObj.arTemplateParams["STYLES_TITLE"];for(t=0,s=this.filter.length;t<s;t++){i=this.pMainObj.oStyles.GetStyles(this.filter[t]);for(e=0;e<i.length;e++){if(i[e].className=="")continue;if(this.pMainObj.arTemplateParams&&a&&a[i[e].className])o=a[i[e].className];else if(!this.pMainObj.arConfig["bUseOnlyDefinedStyles"])o=i[e].className;else continue;this.CreateListRow(i[e].className,o,{value:i[e].className,name:o});n++}}if(this.additionalClass)this.CreateListRow(this.additionalClass,this.additionalClass,{value:this.additionalClass,name:this.additionalClass});if(this.deleteIfNoItems)this.pWnd.style.display=n==0?"none":"block"};BXStyleList.prototype.CreateListRow=function(t,e,i){i.index=this.values.length;var s=this,o=this.pDropDownList.insertRow(-1).insertCell(-1),n=o.appendChild(BX.create("TABLE",{props:{className:"bx-list-item",title:e,unselectable:"on"}},BXPopupWindow.pDocument)),a=n.insertRow(-1),l=a.insertCell(-1);l.innerHTML=e;if(this.bSetFontSize)l.style.fontSize="12px";if(this.pMainObj.bRenderStyleList){switch(this.tag_name.toUpperCase()){case"TD":l.className=t;break;case"TABLE":n.className=t;break;case"TR":a.className=t;break;default:l.innerHTML='<span class="'+t+'">'+e+"</span>"}}n.value=i;n.onmouseover=function(t){BX.addClass(this,"bx-list-item-over")};n.onmouseout=function(t){BX.removeClass(this,"bx-list-item-over")};n.onclick=function(t){s.Close();s._OnChange(this.value);s.FireChangeEvent();if(this.value.value=="")s.SelectByVal()};this.values.push(i)};BXStyleList.prototype.OnChange=function(t){this.pMainObj.WrapSelectionWith("SPAN",{props:{className:t["value"]}})};BXStyleList.prototype._SetFilter=function(){this.filter=["DEFAULT"]};BXStyleList.prototype.OptimizeSelection=function(t){var e=t.nodes,i,s,o=e.length;for(s=0;s<o;s++){i=e[s];if(i.parentNode){}this.CleanChildsClass(i)}},BXStyleList.prototype.RemoveClass=function(t,e){if(!t)return;var i=false,s;while(!i){if(!t)break;if(t.nodeType==1){s=t.nodeName.toLowerCase();if(s=="span"||s=="font"&&t.className){i=true;break}}t=t.parentNode}if(i){t.className="";t.removeAttribute("class");if(this.CheckNodeAttributes(t))BXCutNode(t);this.CleanChildsClass(t)}},BXStyleList.prototype.CleanChildsClass=function(t){CheckChilds(t,{func:function(t){if(t.nodeType!=1)return;var e=t.nodeName.toLowerCase();if(e=="span"||e=="font"&&t.className!=""){t.className="";t.removeAttribute("class");if(this.CheckNodeAttributes(t))BXCutNode(t)}},obj:this})},BXStyleList.prototype.CheckNodeAttributes=function(t){var e=t.attributes.length<=0;if(!e){var i=false,s,o,n,a=t.attributes.length,l={title:true,id:true,name:true,style:true};for(n=0;n<a;n++){s=BX.util.trim(t.attributes[n].value);o=t.attributes[n].name.toString().toLowerCase();if(l[o]&&s!=""&&s!="null"){i=true;break}}if(!i)e=true}return e};function BXTransOverlay(t){this.id="lhe_trans_overlay";this.zIndex=t.zIndex||100}BXTransOverlay.prototype={Create:function(){this.bCreated=true;this.bShowed=false;var t=BX.GetWindowScrollSize();this.pWnd=document.body.appendChild(BX.create("DIV",{props:{id:this.id,className:"bxed-trans-overlay"},style:{zIndex:this.zIndex,width:t.scrollWidth+"px",height:t.scrollHeight+"px"}}));this.pWnd.ondrag=BX.False;this.pWnd.onselectstart=BX.False},Show:function(t){if(!this.bCreated)this.Create();this.bShowed=true;var e=BX.GetWindowScrollSize();this.pWnd.style.display="block";this.pWnd.style.width=e.scrollWidth+"px";this.pWnd.style.height=e.scrollHeight+"px";if(!t)t={};if(t.zIndex)this.pWnd.style.zIndex=t.zIndex;BX.bind(window,"resize",BX.proxy(this.Resize,this));return this.pWnd},Hide:function(){if(!this.bShowed)return;this.bShowed=false;this.pWnd.style.display="none";BX.unbind(window,"resize",BX.proxy(this.Resize,this));this.pWnd.onclick=null},Resize:function(){if(this.bCreated)this.pWnd.style.width=BX.GetWindowScrollSize().scrollWidth+"px"}};function BXEdColorPicker(){this.disabled=false;this.bCreated=false;this.bOpened=false;this.zIndex=2090;this.arColors=["#FF0000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF","#FFFFFF","#EBEBEB","#E1E1E1","#D7D7D7","#CCCCCC","#C2C2C2","#B7B7B7","#ACACAC","#A0A0A0","#959595","#EE1D24","#FFF100","#00A650","#00AEEF","#2F3192","#ED008C","#898989","#7D7D7D","#707070","#626262","#555","#464646","#363636","#262626","#111","#000000","#F7977A","#FBAD82","#FDC68C","#FFF799","#C6DF9C","#A4D49D","#81CA9D","#7BCDC9","#6CCFF7","#7CA6D8","#8293CA","#8881BE","#A286BD","#BC8CBF","#F49BC1","#F5999D","#F16C4D","#F68E54","#FBAF5A","#FFF467","#ACD372","#7DC473","#39B778","#16BCB4","#00BFF3","#438CCB","#5573B7","#5E5CA7","#855FA8","#A763A9","#EF6EA8","#F16D7E","#EE1D24","#F16522","#F7941D","#FFF100","#8FC63D","#37B44A","#00A650","#00A99E","#00AEEF","#0072BC","#0054A5","#2F3192","#652C91","#91278F","#ED008C","#EE105A","#9D0A0F","#A1410D","#A36209","#ABA000","#588528","#197B30","#007236","#00736A","#0076A4","#004A80","#003370","#1D1363","#450E61","#62055F","#9E005C","#9D0039","#790000","#7B3000","#7C4900","#827A00","#3E6617","#045F20","#005824","#005951","#005B7E","#003562","#002056","#0C004B","#30004A","#4B0048","#7A0045","#7A0026"]}BXEdColorPicker.prototype={_Create:function(){this.pWnd=BX.create("DIV",{props:{className:"bx-ed-colorpicker"}});var t=this;if(this.OnSelectionChange)this.pMainObj.AddEventHandler("OnSelectionChange",this.OnSelectionChange,this);if(this.disableOnCodeView)this.pMainObj.AddEventHandler("OnChangeView",this.OnChangeView,this);if(this.with_input){this.pInput=this.pWnd.appendChild(BX.create("INPUT",{props:{size:7}}));if(t.OnChange)this.pInput.onchange=function(){t.OnChange(this.value)}}if(!this.id)this.id="BackColor";this.pIcon=this.pWnd.appendChild(BX.create("IMG",{props:{id:"bx_btn_"+this.id,title:this.title,src:one_gif_src,className:"bxedtbutton"},style:{border:"1px solid "+borderColorNormal,backgroundImage:"url("+image_path+"/_global_iconkit.gif)"}}));this.pIcon.onclick=function(e){t.OnClick(e,this)};this.pIcon.onmouseover=function(e){if(!t.disabled){BX.addClass(this,"bxedtbuttonover")}};this.pIcon.onmouseout=function(e){if(!t.disabled){BX.removeClass(this,"bxedtbuttonover")}}},Create:function(){var t=this;this.pColCont=document.body.appendChild(BX.create("DIV",{props:{className:"bx-colpick-cont"}}));BX.ZIndexManager.register(this.pColCont);var e,i,s,o=BX.create("TABLE",{props:{className:"bx-colpic-tbl"}}),n,a=this.arColors.length;e=o.insertRow(-1);i=e.insertCell(-1);i.colSpan=8;var l=i.appendChild(BX.create("SPAN",{props:{className:"bx-colpic-def-but"},text:BX_MESS.CPickDef}));s=BX.adjust(e.insertCell(-1),{props:{colSpan:8,className:"bx-color-inp-cell"},style:{backgroundColor:this.arColors[38]}});l.onmouseover=function(){this.className="bx-colpic-def-but bx-colpic-def-but-over";s.style.backgroundColor="transparent"};l.onmouseout=function(){this.className="bx-colpic-def-but"};l.onclick=function(e){t.Select(false)};for(n=0;n<a;n++){if(Math.round(n/16)==n/16)e=o.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bx-col-cell",id:"bx_color_"+n},html:'<img src="'+one_gif_src+'" />',style:{backgroundColor:this.arColors[n]}});i.onmouseover=function(e){this.className="bx-col-cell bx-col-cell-over";s.style.backgroundColor=t.arColors[this.id.substring("bx_color_".length)]};i.onmouseout=function(t){this.className="bx-col-cell"};i.onclick=function(e){t.Select(t.arColors[this.id.substring("bx_color_".length)])}}this.pColCont.appendChild(o);this.bCreated=true},OnClick:function(t,e){if(this.disabled)return false;if(!this.bCreated)this.Create();if(this.bOpened)return this.Close();this.Open()},Open:function(){var t=BX.align(BX.pos(this.pIcon),325,155),e=this;BX.bind(document,"keyup",BX.proxy(this.OnKey,this));BX.bind(this.pMainObj.pEditorDocument,"keyup",BX.proxy(this.OnKey,this));oPrevRange=BXGetSelectionRange(this.pMainObj.pEditorDocument,this.pMainObj.pEditorWindow);BX.ZIndexManager.bringToFront(this.pColCont);var i=this.pColCont.style.zIndex-1;var s=this.pMainObj.oTransOverlay.Show({zIndex:i});s.onclick=function(){e.Close()};this.pColCont.style.display="block";this.pColCont.style.top=t.top+"px";this.pColCont.style.left=t.left+"px";this.bOpened=true},Close:function(){this.pColCont.style.display="none";this.pMainObj.oTransOverlay.Hide();BX.unbind(document,"keyup",BX.proxy(this.OnKey,this));BX.unbind(this.pMainObj.pEditorDocument,"keyup",BX.proxy(this.OnKey,this));this.bOpened=false},OnMouseOver:function(t){if(!this.disabled){this.pIcon.style.borderColor=borderColorOver;this.pIcon.style.border="#4B4B6F 1px solid";this.pIcon.style.backgroundColor=bgroundColorOver}},OnMouseOut:function(t){if(!this.disabled){this.pIcon.style.backgroundColor="";this.pIcon.style.borderColor=borderColorNormal}},OnKey:function(t){if(!t)t=window.event;if(t.keyCode==27)this.Close()},Select:function(t){if(!t)t="";if(this.pInput)this.pInput.value=t;BXSelectRange(oPrevRange,this.pMainObj.pEditorDocument,this.pMainObj.pEditorWindow);if(this.OnChange)this.OnChange(t);this.Close()},OnChangeView:function(t,e){t=t=="split"?e:t;this.Disable(t=="code")},Disable:function(t){if(t==this.disabled)return false;this.disabled=this.pIcon.disabled=t;if(t)BX.addClass(this.pIcon,"bxedtbutton-disabled");else BX.removeClass(this.pIcon,"bxedtbutton-disabled")},SetValue:function(t){if(this.pInput)this.pInput.value=t}};function BXTAlignPicker(){this.disabled=false;this.bCreated=false;this.bOpened=false;this.zIndex=2090;this.arIcon=["tl","tc","tr","cl","cc","cr","bl","bc","br"];this.arIconH=["left","center","right"];this.arIconV=["top","middle","bottom"];this.arIconName=[BX_MESS.TAlign1,BX_MESS.TAlign2,BX_MESS.TAlign3,BX_MESS.TAlign4,BX_MESS.TAlign5,BX_MESS.TAlign6,BX_MESS.TAlign7,BX_MESS.TAlign8,BX_MESS.TAlign9]}BXTAlignPicker.prototype={_Create:function(){this.pWnd=BX.create("TABLE",{props:{className:"bx-ed-alignpicker"}});var t=this,e=this.pWnd.insertRow(-1),i=e.insertCell(-1);this.pIcon=i.appendChild(BX.create("IMG",{props:{id:"bx_btn_align_tl",src:one_gif_src,className:"bxedtbutton"},style:{border:"1px solid "+borderColorNormal,backgroundImage:"url("+image_path+"/_global_iconkit.gif)"}}));if(this.title)this.pIcon.title=this.title;this.pIcon.onclick=function(e){t.OnClick(e,this)};this.pIcon.onmouseover=function(t){BX.addClass(this,"bxedtbuttonover")};this.pIcon.onmouseout=function(t){BX.removeClass(this,"bxedtbuttonover")}},Create:function(){this.pPopupNode=document.body.appendChild(BX.create("DIV",{props:{className:"bx-alpick-cont"}}));BX.ZIndexManager.register(this.pPopupNode);var t=this,e,i,s,o,n=this.pPopupNode.appendChild(BX.create("TABLE",{props:{className:"bx-alpic-tbl"}})),a;e=n.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bx-alpic-default",colSpan:3},html:"<nobr>"+BX_MESS.TAlignDef+"</nobr>"});i.onmouseover=function(t){BX.addClass(this,"bxedtbuttonover")};i.onmouseout=function(t){BX.removeClass(this,"bxedtbuttonover")};i.onclick=function(e){t._OnChange("","");t.Close()};for(a=0;a<3;a++){e=n.insertRow(-1);for(s=0;s<3;s++){i=e.insertCell(-1);i.className="bx-alpic-but";if(this.type!="image"||a==1||s==1){o=i.appendChild(BXPopupWindow.CreateElement("DIV",{id:"bx_btn_align_"+this.arIcon[a*3+s],className:"bxedtbutton",title:this.arIconName[a*3+s]},{border:"1px solid "+borderColorNormal,backgroundImage:"url("+global_iconkit_path+")"}));if(this.type=="image"){o.val=s==1?this.arIconV[a]:this.arIconH[s];o.onclick=function(e){t._OnChangeI(this.val);t.Close()}}else{o.valH=this.arIconH[s];o.valV=this.arIconV[a];o.onclick=function(e){t._OnChange(this.valH,this.valV);t.Close()}}o.onmouseover=function(t){BX.addClass(this,"bxedtbuttonover")};o.onmouseout=function(t){BX.removeClass(this,"bxedtbuttonover")}}}}this.bCreated=true},Open:function(){var t=BX.align(BX.pos(this.pIcon),91,102),e=this;BX.bind(document,"keyup",BX.proxy(this.OnKey,this));BX.bind(this.pMainObj.pEditorDocument,"keyup",BX.proxy(this.OnKey,this));oPrevRange=BXGetSelectionRange(this.pMainObj.pEditorDocument,this.pMainObj.pEditorWindow);BX.ZIndexManager.bringToFront(this.pPopupNode);var i=this.pPopupNode.style.zIndex-1;var s=this.pMainObj.oTransOverlay.Show({zIndex:i});s.onclick=function(){e.Close()};this.pPopupNode.style.display="block";this.pPopupNode.style.top=t.top+"px";this.pPopupNode.style.left=t.left+"px";this.bOpened=true},Close:function(){this.pPopupNode.style.display="none";this.pMainObj.oTransOverlay.Hide();BX.unbind(document,"keyup",BX.proxy(this.OnKey,this));BX.unbind(this.pMainObj.pEditorDocument,"keyup",BX.proxy(this.OnKey,this));this.bOpened=false},_OnChange:function(t,e){if(this.OnChange)this.OnChange(t,e);this.SetValue(t,e)},_OnChangeI:function(t){if(this.OnChange)this.OnChange(t);this.SetValueI(t)},SetValue:function(t,e){if(this.type=="image")return this.SetValueI(t);for(var i=0;i<3;i++)if(this.arIconH[i]==t)break;for(var s=0;s<3;s++)if(this.arIconV[s]==e)break;if(s>2)s=1;if(i>2)i=0;this.pIcon.id="bx_btn_align_"+this.arIcon[s*3+i];this.pIcon.title=this.arIconName[s*3+i];return s*3+i},SetValueI:function(t){var e,i=0;for(e=0;e<3;e++)if(this.arIconV[e]==t){i=1;break}if(i!=1)for(i=0;i<3;i++)if(this.arIconH[i]==t){e=1;break}if(e>2)e=1;if(i>2)i=0;this.pIcon.id="bx_btn_align_"+this.arIcon[e*3+i];this.pIcon.title=this.arIconName[e*3+i];return e*3+i},OnClick:function(t){if(this.disabled)return false;if(!this.bCreated)this.Create();if(this.bOpened)return this.Close();this.Open()},OnKey:function(t){if(this.bOpened){if(!t)t=window.event;if(t.keyCode==27)this.Close()}}};function BXDialog(){}BXDialog.prototype={_Create:function(){var t=this;this.pMainObj._DisplaySourceFrame(true);if(!this.params||typeof this.params!="object")this.params={};this.params.pMainObj=this.pMainObj;pObj=window.pObj=this;oPrevRange=BXGetSelectionRange(this.pMainObj.pEditorDocument,this.pMainObj.pEditorWindow);var e=function(e,i){BX.closeWait();if(window.oBXEditorDialog&&window.oBXEditorDialog.isOpen)return false;var s={title:t.name,width:t.width,height:300,resizable:false};if(i){if(e.title)s.title=e.title;if(e.width)s.width=e.width;if(e.height)s.height=e.height;if(e.resizable){s.resizable=true;s.min_width=e.min_width;s.min_height=e.min_height;s.resize_id=e.resize_id}}window.oBXEditorDialog=new BX.CEditorDialog(s);window.oBXEditorDialog.editorParams=t.params;BX.addCustomEvent(window.oBXEditorDialog,"onWindowUnRegister",function(){if(window.oBXEditorDialog&&window.oBXEditorDialog.DIV&&window.oBXEditorDialog.DIV.parentNode)window.oBXEditorDialog.DIV.parentNode.removeChild(window.oBXEditorDialog.DIV)});if(i){window.oBXEditorDialog.Show();window.oBXEditorDialog.SetContent(e.innerHTML);if(e.OnLoad&&typeof e.OnLoad=="function")e.OnLoad()}};BX.showWait();var i=this.GetFastDialog();if(i!==false)return e(i,true);var s=(this.params.PHPGetParams?this.params.PHPGetParams:"")+"&mode=public"+"&sessid="+BX.bitrix_sessid()+(this.not_use_default?"&not_use_default=Y":""),o=this.handler?"/bitrix/admin/"+this.handler:editor_dialog_path,n=o+"?lang="+BXLang+"&bxpublic=Y&site="+BXSite+"&name="+this.name+s;if(t.params.bUseTabControl){BX.closeWait();window.oBXEditorDialog=new BX.CAdminDialog({title:t.name,content_url:n,width:t.width,resizable:false});window.oBXEditorDialog.bUseTabControl=true;window.oBXEditorDialog.Show()}else{n+="&bxsender=core_window_cadmindialog";BX.ajax.post(n,{},e)}},Close:function(){},GetFastDialog:function(){return window.arEditorFastDialogs[this.name]?window.arEditorFastDialogs[this.name](this):false}};BXHTMLEditor.prototype.OpenEditorDialog=function(t,e,i,s,o){this.CreateCustomElement("BXDialog",{width:parseInt(i)||500,name:t,params:s||{},not_use_default:o})};
//# sourceMappingURL=controls.map.js